﻿using System.Linq;
using System.Web.Mvc;

namespace ComeSeeThis_MVC2.Models
{
    public class VehicleTypesFormView : Controller
    {
        #region Properties

        public VehicleType VehicleType { get; private set; }
        public SelectList Scales { get; private set; }
        public IQueryable<Vehicle> Vehicles{ get; private set;}

        #endregion

        public VehicleTypesFormView(VehicleType vehicleType)
        {
            VehicleType = vehicleType;
            //Scales = new SelectList(new Scale().GetAllItems<Scale>(), VehicleType.VehicleTypeId);
            Scales = new SelectList(new[] {4, 5, 8, 10, 12, 16, 18, 24}, VehicleType.Scale);
            Vehicles = new VehicleRepository().GetAllVehiclesByVehicleType(vehicleType.VehicleTypeId);
        }
    }
}
